home *** CD-ROM | disk | FTP | other *** search
- #ifndef _VARARGS_H
- #define _VARARGS_H
-
- /* varargs.h */
-
- #ifndef __GNUC__
- typedef char *va_list;
-
- #define va_dcl int va_alist;
- #define va_start(p) (p) = (va_list) &va_alist;
- #define va_arg(p,type) ( (type *) ((p)+=sizeof(type)) )[-1]
- #define va_end(p)
-
- #else
-
- /* These macros implement traditional (non-ANSI) varargs
- for GNU C. */
-
- #define va_alist __builtin_va_alist
- #define va_dcl int __builtin_va_alist;
- #define va_list char *
-
- #define va_start(AP) AP=(char *) &__builtin_va_alist
- #define va_end(AP)
-
- #define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
- #define va_arg(AP, TYPE) \
- (AP += __va_rounded_size (TYPE), \
- ((TYPE *) AP)[-1])
-
- #endif /* __GNUC__ */
-
- #ifdef __STDC__
- #ifndef __NO_PROTO__
- int vsprintf(char *,const char *, char *);
- int vprintf(const char *, char *);
- int vfprintf(FILE *, const char *, char *);
- #else
- int vsprintf();
- int vprintf();
- int vfprintf();
- #endif
- #else
- extern int vsprintf();
- extern int vprintf();
- extern int vfprintf();
- #endif
-
- #endif /* _VARARGS_H */
-